// 首页数据全部在这里进行模拟
import Mock from 'mockjs'
// let { data } = Mock.mock({
//     'data|20': [{
//         'studentId|1': ['12001', '12002', '12003', '12004', ],
//         'studentName|1': '@cname(3)',
//         'studentOrder|+1': 1,
//         'studentAttendance|1': ['已出勤', '未出勤'],
//         'studentTel': /^(?:(?:))?1[3-9]\d{9}$/,
//         'studentinteraction|1-100': 100,
//     }]
// })


// 直播数据
let { broadcastList } = Mock.mock({
    'broadcastList|100': [{
        // 'time|1': '@datetime("yyyy-M-d A HH:mm:ss")',
        'class|1': ['2210', '2211', '2212', '2213', '2214', '2215'],
        'time|1': [
            ["2022/12/30", "12:52:14"],
            ["2022/12/30", "8:34:14"],
            ["2022/12/31", "15:23:14"],
            ["2023/1/1", "12:52:14"],
            ["2023/1/1", "12:52:14"],
            ["2023/1/2", "12:52:14"],
            ["2023/1/2", "12:52:14"],
            ["2023/1/3", "12:52:14"],
            ["2023/1/4", "12:52:14"],
            ["2023/1/4", "12:52:14"],
            ["2023/1/5", "12:52:14"],
            ["2023/1/5", "12:52:14"],
        ],
        'type|1': ['离散分析', '线性代数', '微积分', '高等数学', '前端HTML5'],
        'teacherName|1': ['张老师', '袁老师', '李老师'],
    }]
});
// 获取直播数据的后端逻辑
Mock.mock('/getBroadcastList', 'get', (config) => {
    let data = JSON.parse(config.body);
    let className = data.class;
    let date = data.date;
    let newData = broadcastList.filter((item) => {
        let flag1 = date == item.time[0];
        let flag2 = className == item.class;
        return flag1 && flag2
    })

    return {
        code: '200',
        msg: '请求成功',
        data: newData
    }
});

// 配班教师
let { teacherList } = Mock.mock({
    'teacherList|15': [{
        'class|1': ['2210', '2211', '2212', '2213', '2214', '2215'],
        'type|1': ['离散分析', '线性代数', '微积分', '高等数学', '前端HTML5'],
        'teacherName|1': ['张老师', '袁老师', '李老师', '尧老师'],
        'teacherTel': /^(?:(?:))?1[3-9]\d{9}$/,
        'img|1': '@dataImage("50x50")',
    }]
});

// 获取配班教师的后端逻辑
Mock.mock('/getTeacherList', 'get', (config) => {
    let data = JSON.parse(config.body);
    let className = data.class;
    let newData = teacherList.filter((item) => {
        let flag2 = className == item.class;
        return flag2
    })

    return {
        code: '200',
        msg: '请求成功',
        data: newData
    }
});


// 学员评价
let { stuIdeaList } = Mock.mock({
    'stuIdeaList|80': [{
        'class|1': ['2210', '2211', '2212', '2213', '2214', '2215'],
        'time|1': [
            ["2022/12/30", "12:52:14"],
            ["2022/12/30", "8:34:14"],
            ["2022/12/31", "15:23:14"],
            ["2023/1/1", "12:52:14"],
            ["2023/1/1", "12:52:14"],
            ["2023/1/2", "12:52:14"],
            ["2023/1/2", "12:52:14"],
            ["2023/1/3", "12:52:14"],
            ["2023/1/4", "12:52:14"],
            ["2023/1/4", "12:52:14"],
            ["2023/1/5", "12:52:14"],
            ["2023/1/5", "12:52:14"],
        ],
        'level|1': ['★', '★★', '★★★', '★★★★', '★★★★★'],
        'studentName|1': '@cname(3)',
        'img|1': '@dataImage("80x80")',
        'detail|1': '@cparagraph()'
    }]
});
// 获取学员评价的后端逻辑
Mock.mock('/getStuIdeaList', 'get', (config) => {
    let data = JSON.parse(config.body);
    let className = data.class;
    let newData = stuIdeaList.filter((item) => {
        let flag2 = className == item.class;
        return flag2
    })

    return {
        code: '200',
        msg: '请求成功',
        data: newData
    }
});

// 任务安排表格数据
let { jobList } = Mock.mock({
    'jobList|100': [{
        'time|1': [
            ["2022/12/30", "12:52:14"],
            ["2022/12/30", "8:34:14"],
            ["2022/12/31", "15:23:14"],
            ["2023/1/1", "12:52:14"],
            ["2023/1/1", "12:52:14"],
            ["2023/1/2", "12:52:14"],
            ["2023/1/2", "12:52:14"],
            ["2023/1/3", "12:52:14"],
            ["2023/1/4", "12:52:14"],
            ["2023/1/4", "12:52:14"],
            ["2023/1/5", "12:52:14"],
            ["2023/1/5", "12:52:14"],
        ],
        'jobName|1': '@csentence(5, 8)',
        'jobContent|1': '@csentence(8, 13)',
        'jobCount|1-80': 80
    }]
});
// 获取配班教师的后端逻辑
Mock.mock('/getJobList', 'get', (config) => {
    return {
        code: '200',
        msg: '请求成功',
        data: jobList
    }
});


// 二维码
let erWeiMaList = [{
        type: '离散分析',
        img: '../../../public/2210邀请码.gif',
        code: 'F125S5'
    }, {
        type: '线性代数',
        img: '../../../public/2211邀请码.gif',
        code: 'S445D5'
    }, {
        type: '微积分',
        img: '../../../public/2212邀请码.gif',
        code: '45JsS5'
    }, {
        type: '高等数学',
        img: '../../../public/2213邀请码.gif',
        code: '56sDS4'
    }, {
        type: '前端HTML5',
        img: '../../../public/2214邀请码.gif',
        code: 'pPkdk5'
    }, {
        type: 'JAVA',
        img: '../../../public/2215邀请码.gif',
        code: '4wOs6a'
    }]
    // 获取配班教师的后端逻辑
Mock.mock('/getErWeiMaList', 'get', (config) => {
    let data = JSON.parse(config.body);
    let className = data.type;
    let newData = erWeiMaList.filter((item) => {
        let flag2 = className == item.type;
        return flag2
    })
    return {
        code: '200',
        msg: '请求成功',
        data: newData
    }
})